package cn.wolfcode.luowowo.common.query;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class TravelQueryObject extends QueryObject {

    private Integer state = -1;

    private Long destId = -1L;

    private Integer orderType = -1;
    private Integer destIde = -1;
    private Integer travelTimeType = -1;
    private Integer perExpendType = -1;
    private Integer dayType = -1;

    //提供getter在mapper中调用,进行翻译
    public String getOrderBy() {
        //最新,最热(点击数多)
        return orderType == 1 ? "releaseTime desc" : "t.viewnum desc";
    }

    //出行时间
    public TravelCondition getTravelTime() {
        return TravelCondition.TRAVEL_TIME.get(travelTimeType);
    }

    //人均花费
    public TravelCondition getPerExpends() {
        return TravelCondition.TRAVEL_PER_EXPEND.get(perExpendType);
    }
    //出发天数
    public TravelCondition getDays() {
        return  TravelCondition.TRAVEL_DAYS.get(dayType);

    }


}
